#
# Copyright (C) [2024] Xingyun Integrated Circuit, Inc.
#
# GreenCode was a private technology asset of Xingyun Integrated Circuit， Inc （Confidential）
# Author: Shawn.Tan
# Date: 2025.10.28
#
# History: Initial Version 2025.10.28
#
#
import RandomUtils

from DV.gpgpu.trees.instruction_tree import RV64I_map, RV32I_map
from base.Sequence import Sequence
from gpgpu.EnvGPGPU import EnvGPGPU
from gpgpu.GenThreadGPGPU import GenThreadGPGPU


# This test is intended to be run with mulitple threads to verify that
# multiprocess generation and simulation are basically functional.
class MainSequence(Sequence):
    def generate(self, **kargs):
        for _ in range(RandomUtils.random32(250, 300)):
            if self.getGlobalState("AppRegisterWidth") == 32:
                instr = RV32I_map.pick(self.genThread)
            else:
                instr = RV64I_map.pick(self.genThread)
            self.genInstruction(instr)


MainSequenceClass = MainSequence
GenThreadClass = GenThreadGPGPU
EnvClass = EnvGPGPU
